home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-01 / neuron.zip / NETWORK.DOC < prev    next >
Encoding:
Text File  |  1992-07-06  |  4.7 KB  |  91 lines

  1. *********************************************************************
  2.  
  3.                             NETWORK.DOC
  4.  
  5. *********************************************************************
  6.  
  7. VERSION 2.5     E.FARHI     07/92       TC 2.0
  8.  
  9.  
  10.  
  11. This is a short doc file for NETWORK.C
  12.  
  13. Read it carefully, it explains how to make and use a network.
  14.  
  15. You should have already read THEORY.DOC....
  16.  
  17.  
  18.  
  19. I shall tell you about local procedures and using NEURON.C .
  20.  
  21.  
  22.  
  23. ***  Local procedures
  24.  
  25.  
  26.  
  27. print_output(net)
  28.  
  29.         Prints the last layer state.
  30.  
  31. vector_modify(vector,size,high,low)
  32.  
  33.         Modifies a vector containing some binary data (0 and 1) into a vector 
  34.         containing low and high states, in order to send it to the net.
  35.  
  36. sort(vector,order,size)
  37.  
  38.         Sorts a vector and sends back the sorting order.
  39.  
  40. print_input(Xmax,Ymax,input)
  41.  
  42.         Prints the input as a Xmax*Ymax array (for caracters).
  43.  
  44. print_result(net)
  45.  
  46.         Sorts and prints the network answer (output layer).
  47.  
  48.         Gives the network identification of a caracter.
  49.  
  50. init_std_network(net)
  51.  
  52.         Standart init of a net. If you don't want to think of how to initialize 
  53.         a net...The network is then a multi-preceptron one.
  54.  
  55. learn(...)
  56.  
  57.         Supervized learning using optimization algorithm.
  58.  
  59. verify(...)
  60.  
  61.         Verifies that the net has a good memory.
  62.  
  63.  
  64.  
  65. *** How do I build my network.
  66.  
  67.  
  68.  
  69.         First of all, you need to define your network size. For this initialize 
  70. nb_layers, nb_n_layer, nb_levels, layer_order. If you want to understand how 
  71. the layer order works, see NEURON.DOC.
  72.  
  73.         Then, you need to set the prototypes. Each prototype is associated to 
  74. an output neuron (a neuron for each class). In the given example, the input isa 
  75. 5*7 array, and the output, the alphabet.
  76.  
  77.  
  78.  
  79.         You allocate memory and prepare the prototypes with vector_modify.
  80.  
  81.         To teach the network, the only thing to do is to run 'learn_opt'.
  82.  
  83.  
  84.  
  85.         Some disk utilities are available, and I even show how to recognize a 
  86. 'strange' 'V' (not too strange). Finally, the network gives its answer...
  87.  
  88.  
  89.  
  90. *** Some advice. (see 'init_std_network')
  91.  
  92.  
  93.  
  94.         I use a three precepton network because it can learn many things, and 
  95. computation is fast. The answering time is also quick. On the contrary, an 
  96. Hopfield net is slow (because it needs to stabilize) and can't memorize too 
  97. many things. A {0,1,2} order is fine.
  98.  
  99.         The simulated tempering is useful when the net has difficulties to 
  100. learn, especially for Hopfield layers, because it enables to avoid interference 
  101. states created during the learning. You can decide of the tempering 
  102. temperatures and the exponential decreasing constant. If that constant is too 
  103. small, the learning time becomes very important.
  104.  
  105.         The error threshold defines the learning depth. If it's high, the 
  106. learning is quick but the network doesn't know very well the prototypes at the 
  107. end. If it's low, learning time is longer, and the net has a good memory. 
  108. Anyway, it has been shown that a too small threshold doesn't fit well with the 
  109. generalization capacity. A net too specialized in what it has learnt can't 
  110. extrapolate its knowledge to unknown prototypes. That's why a 5 % to 10 % error 
  111. threshold is enough
  112.  
  113.         The network temperature is a variable important. Finding an optimal 
  114. value is difficult. I use a value between 0.1 and 10 (why not 1), except during 
  115. tempering.
  116.  
  117.         The improving variation coefficient for modifying links during 
  118. backpropagation can't be too high, else the network oscillates, even with the 
  119. shaker algorithm. Theorically, a high value decreases the learning time.. So 
  120. it's better too have a longer learning, but to be sure that the net will learn 
  121. something ! It depends of temperature. With beta=1/T=0.3 I use coef=0.3 .
  122.  
  123.         If you use (as I do) continuum neurons, the high and low state can't be 
  124. reached because of the sigmoid shape (to reach those value, the potentials have 
  125. to be infinite, what leads to network saturation). So, for the learning 
  126. procedure, you have to impose some lower states in the outputs. That's why 
  127. coef_out is not 1 but 0.9 , then outputs are reachable.
  128.  
  129.         The links and potential thresholds have to be used, to avoid the net 
  130. overflow. If the link threshold is low, the net can't memorize everything, and 
  131. will prefer to forget old prototypes, ad to learn the new ones. The bascule 
  132. threshold is generally 0 (else it causesa disymetry).
  133.  
  134.         The random noise enables the net to avoid interference states. 5 % to 
  135. 10 % is good.
  136.  
  137.         the high and low states are usually +1 and -1. (0 and +1 is also 
  138. possible)
  139.  
  140.  
  141.  
  142.         Anyway, to understand better this, you should have a look to the 
  143. 'init_std_network' procedure in NETWORK.C .
  144.  
  145.